package com.ruoyi.asset.tool.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.asset.tool.domain.Tool;
import com.ruoyi.asset.tool.domain.bo.ToolSearchBo;
import com.ruoyi.asset.tool.domain.bo.ToolStatisticsBo;
import com.ruoyi.asset.tool.domain.vo.ToolVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


/**
 * 作业工具导入明细Mapper接口
 *
 * @author lq
 * @date 2023-11-29
 */
public interface ToolMapper extends BaseMapperPlus<ToolMapper, Tool, ToolVo> {

    /**
     * 查询作业工具
     */
    Page<ToolVo> selectToolPage(IPage<ToolVo> page, @Param("searchBo") ToolSearchBo searchBo);

    /**
     * 导出作业工具
     */
    List<ToolVo> exportTool(@Param("searchBo") ToolSearchBo searchBo);

    /**
     * 按服务类型统计作业工具
     */
    Map statisticsToolByServiceType(@Param("serviceType") String serviceType);

    /**
     *
     * @param serviceType
     * @param type
     * @return
     */
    Integer selectToolCount(@Param("serviceType") String serviceType,@Param("type") Integer type);

    Integer selectToolCountByCommunity (@Param("serviceType") String serviceType,@Param("type") Integer type
        ,@Param("community") String community);

    Integer selectCommunityByServiceTypeAndDate (@Param("serviceType") String serviceType ,@Param("type") Integer type
                                                  ,@Param("community") String community ,@Param("date") String date);
}
